home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 142
/
Volume 142 Oct 17 2011 - Damaged.iso
/
Games
/
moko-moko.swf
/
scripts
/
__Packages
/
CMG_AS2
/
ScoreSubmitter.as
< prev
next >
Wrap
Text File
|
2011-10-17
|
7KB
|
166 lines
if(true)
{
if(true)
{
§§push(false);
}
if(!§§pop())
{
if(true)
{
if(true)
{
§§push(false);
}
if(!§§pop())
{
if(!_global.CMG_AS2)
{
_global.CMG_AS2 = new Object();
}
§§pop();
if(!_global.CMG_AS2.ScoreSubmitter)
{
var _loc2_ = CMG_AS2.ScoreSubmitter = function()
{
}.prototype;
_loc2_.submitScore = function(playerName, playerScore, playerSpecial)
{
playerName = CMG_AS2.Utilities.trim(playerName);
CMG_AS2.ScoreSubmitter.gameVersion = CMG_AS2.Utilities.trim(CMG_AS2.ScoreSubmitter.gameVersion);
if(playerSpecial == null)
{
playerSpecial = "";
}
else
{
playerSpecial = CMG_AS2.Utilities.trim(playerSpecial);
}
CMG_AS2.ScoreSubmitter.gameValidationCode = CMG_AS2.Utilities.trim(CMG_AS2.ScoreSubmitter.gameValidationCode);
if(CMG_AS2.ScoreSubmitter.gameId < 1 || CMG_AS2.ScoreSubmitter.gameVersion == "" || CMG_AS2.ScoreSubmitter.gameValidationCode == "")
{
if(CMG_AS2.ScoreSubmitter.responseHandler != null)
{
CMG_AS2.ScoreSubmitter.responseHandler(CMG_AS2.ScoreSubmitter.RETURNCODE_REJECTED);
}
return undefined;
}
var _loc2_ = new LoadVars();
_loc2_.name = playerName;
_loc2_.score = playerScore;
_loc2_.gameId = CMG_AS2.ScoreSubmitter.gameId;
_loc2_.gameVersion = CMG_AS2.ScoreSubmitter.gameVersion;
_loc2_.special = playerSpecial;
var _loc6_ = new CMG_AS2.MD5();
_loc2_.key = _loc6_.calcMD5(playerName + "|" + playerScore + "|" + CMG_AS2.ScoreSubmitter.gameId + "|" + playerSpecial + "|" + CMG_AS2.ScoreSubmitter.gameValidationCode);
if(CMG_AS2.ScoreSubmitter.responseHandler != null)
{
CMG_AS2.ScoreSubmitter.responseHandler(CMG_AS2.ScoreSubmitter.RETURNCODE_WORKING);
}
_loc2_.sendAndLoad(CMG_AS2.ScoreSubmitter.URL_SUBMITSCORE,_loc2_,"POST");
_loc2_.onLoad = function(ok)
{
if(ok)
{
var _loc2_ = CMG_AS2.Utilities.trim(this.ok);
if(_loc2_ == 1)
{
if(CMG_AS2.ScoreSubmitter.responseHandler != null)
{
CMG_AS2.ScoreSubmitter.responseHandler(CMG_AS2.ScoreSubmitter.RETURNCODE_SUCCESS);
}
}
else if(_loc2_ == 0)
{
if(CMG_AS2.ScoreSubmitter.responseHandler != null)
{
CMG_AS2.ScoreSubmitter.responseHandler(CMG_AS2.ScoreSubmitter.RETURNCODE_REJECTED);
}
}
else if(_loc2_ == 2)
{
if(CMG_AS2.ScoreSubmitter.responseHandler != null)
{
CMG_AS2.ScoreSubmitter.responseHandler(CMG_AS2.ScoreSubmitter.RETURNCODE_WRONGVERSION);
}
}
else
{
trace("Unknown server response: \'" + this.ok + "\'");
if(CMG_AS2.ScoreSubmitter.responseHandler != null)
{
CMG_AS2.ScoreSubmitter.responseHandler(CMG_AS2.ScoreSubmitter.RETURNCODE_INTERNALERROR);
}
}
}
else
{
trace("Couldn\'t even load the page...\'");
if(CMG_AS2.ScoreSubmitter.responseHandler != null)
{
CMG_AS2.ScoreSubmitter.responseHandler(CMG_AS2.ScoreSubmitter.RETURNCODE_NETWORKERROR);
}
}
};
};
CMG_AS2.ScoreSubmitter = function()
{
}.loadHighScorePage = function()
{
getURL(CMG_AS2.ScoreSubmitter.URL_VIEWSCORES + "?id=" + CMG_AS2.ScoreSubmitter.gameId,"_blank");
};
CMG_AS2.ScoreSubmitter = function()
{
}.loadUpdatePage = function()
{
getURL(CMG_AS2.ScoreSubmitter.URL_UPDATEGAME + "?id=" + CMG_AS2.ScoreSubmitter.gameId,"_blank");
};
CMG_AS2.ScoreSubmitter = function()
{
}.gameId = 0;
CMG_AS2.ScoreSubmitter = function()
{
}.gameVersion = "1.0";
CMG_AS2.ScoreSubmitter = function()
{
}.gameValidationCode = "";
CMG_AS2.ScoreSubmitter = function()
{
}.responseHandler = null;
CMG_AS2.ScoreSubmitter = function()
{
}.URL_VIEWSCORES = "http://scores.crazymonkeygames.com/hs/listscores.php";
CMG_AS2.ScoreSubmitter = function()
{
}.URL_SUBMITSCORE = "http://scores.crazymonkeygames.com/hs/regscores2.php";
CMG_AS2.ScoreSubmitter = function()
{
}.URL_UPDATEGAME = "http://scores.crazymonkeygames.com/hs/pleaseupdate.php";
CMG_AS2.ScoreSubmitter = function()
{
}.RETURNCODE_WORKING = 0;
CMG_AS2.ScoreSubmitter = function()
{
}.RETURNCODE_SUCCESS = 1;
CMG_AS2.ScoreSubmitter = function()
{
}.RETURNCODE_REJECTED = 2;
CMG_AS2.ScoreSubmitter = function()
{
}.RETURNCODE_WRONGVERSION = 3;
CMG_AS2.ScoreSubmitter = function()
{
}.RETURNCODE_NETWORKERROR = 4;
CMG_AS2.ScoreSubmitter = function()
{
}.RETURNCODE_INTERNALERROR = 5;
§§push(ASSetPropFlags(CMG_AS2.ScoreSubmitter.prototype,null,1));
}
§§pop();
}
}
§§goto(addr519);
}
}
addr519: